package com.daon.service.impl;

import com.daon.dao.SysEnterpriseMapper;
import com.daon.pojo.SysEnterprise;
import com.daon.service.ISysEnterpriseManageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 1daon
 * @EMAIL 532418116@qq.com
 * @Version 创建时间：2019/3/22 3:32 PM
 * @Modified By
 */
@Service("iSysEnterpriseManageService")
public class SysEnterpriseManageServiceImpl implements ISysEnterpriseManageService {

    @Autowired
    private SysEnterpriseMapper sysEnterpriseMapper;
    @Override
    public PageInfo getEnterpriseListByKeyword(int pageNum, int pageSize, String keyword) {
        PageHelper.startPage(pageNum, pageSize);
        List<SysEnterprise> sysEnterpriseList = sysEnterpriseMapper.getSysEnterpriseListByKeyword(keyword);
        PageInfo pageResult = new PageInfo(sysEnterpriseList);
        pageResult.setList(sysEnterpriseList);
        return pageResult;
    }
}
